Repository navigation
🤖 tests: cover more startReservedAgentTaskLeased paths before the split - #7755
Conversation
Adds 17 characterization tests to taskService.reservedLaunch.test.ts for launch paths that the launch suites (reservedLaunch, attemptAdmission, settlementReceipts, taskLaunchRepro, creation, createUnderLock) ran without checking. A mutation pass over the split of the method found each as a surviving mutant. No production change. - A row a removal unpublished before the launch ran is left alone (no failure mark). - A launch a held stop latch defers hands its row back to queued, and leaves a row another writer re-admitted as is. - A shared task whose parent checkout exists runs in it with no sanitize step and no init, and its init log ends as done. When a removal unpublishes its row after the materialize step, the cleanup keeps the parent's checkout (preservePhysicalWorkspace). - A row another writer re-admits under its own attempt during the checkout persist keeps its fields and is not sanitized. During the sanitize step it gets no init. Neither is cleaned up or marked failed. - A row a removal unpublishes during the checkout persist gets its checkout cleaned up before the sanitize step. - A row a removal marks before the init gets its checkout cleaned up, no init, and fails. - An unreadable config at the row check after the materialize step or before the init fails the launch and ends its init log. - A materialize step that throws ends the init log and fails the launch. - A forked checkout whose sanitize step fails is reclaimed with its row (its init state is dropped, not ended). When the row cannot be unpublished, or the reclaim throws, the init log ends failed. - A launch whose send fails cleans up its checkout and is marked failed. - A launch its parent cancels during the materialize step is cancelled before the checkout persist. The harness gains a failing send, a failing sanitize step, a failing reclaim and a one-read unreadable config. Each test passes on this commit's code and fails under a scratch edit of the branch it covers. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 46.3k tokens (24% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 19s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 8.0k tokens (22% cached) All 3 tests in 3 files
e2e 0.20.0 · 18.8s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts |
…oder#7751) ## Summary Adds 12 characterization tests for `TaskService.startReservedAgentTaskLeased` (the reserved task launch), with no production change. Line coverage of the method goes from 90 % (331 of 369 lines) to 100 %. This is the test PR at the start of stack 10, the last stack of the TaskService recovery and launch path split. A shared-helper PR and the split PRs go on top of it and split the method (CC 65) into named steps. ## What the tests cover The new file is `taskService.reservedLaunch.test.ts`. Most tests launch through createMany or the queue drain. Two call the lease wrapper `startReservedAgentTask` directly, as `taskService.attemptAdmission.test.ts` does, because no public path reaches a row without an attempt id. - **Early exits:** a Stop writes `interrupted` before the launch runs. A stop latch is held and the write back to `queued` throws. A row without an attempt id, where the stamp write throws, or where another writer stamps a valid id first. - **Materialize:** a Stop during the desktop check makes materialize return nothing for a shared task. A Stop right after materialize keeps the parent's runtime unchanged. A shared task whose parent checkout is gone forks and clears `taskIsolation`. - **Before the send:** an attempt retired during sanitize makes the admission refuse, cleans up the fork and fails the launch. A removal during sanitize cleans up. Cancels during the desktop check, after the checkout write and right before the admission send nothing. The tests check row fields and status, init-log starts and exit codes, registered inits, cleanup and sanitize calls, and sends. No test checks log or message text. ## Size 512 changed lines, 12 over the 500-line cap that the plan sets for split PRs. This PR adds only one test file. Moving a test to coder#7755 would restack 8 PRs and re-run every review to save 12 lines, so it stays one PR. ## Validation - A scratch edit of each covered branch failed its test, and the other tests still passed. I restored the file after each edit. - The new file passed 120 runs (`--rerun-each 10`). - Setup installs tracking for every test. Teardown releases any held stop latch, then waits for every drain, launch, launch-failure handler and background init, also when a test fails early. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high` • Cost: `$334.45`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high costs=334.45 -->
Summary
Adds 17 more characterization tests for
TaskService.startReservedAgentTaskLeased(12 → 29 intaskService.reservedLaunch.test.ts), with no production change. A mutation pass during the split found these paths: with the first 12 tests, 36 of 87 automatic mutants in the moved code survived, and with these tests 11 do. This is a separate PR so #7751 stays near the size limit. It sits below the shared-helper PR and the split, so the tests run against the unsplit code first.What the tests add
They pin the hard points of the launch: the stop-latch revert behind
rowSupersedes, the stamp of a row without an attempt id, the desktop-admission and linearization-point cancels, the unsanitized mark before the reclaim and the order of the reclaim'sfinally, the pre-init rechecks (pendingRemovalincluded), the admission before the send,onlyFromStatus: "starting"on the final status write, and the send options of each start kind.Validation
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$351.07